﻿namespace USElections.TwitterLibrary.Classes
{
    using TweetSharp;

    /// <summary>
    /// Tweet class.
    /// </summary>
    public class Tweet
    {
        #region Fields
        private TwitterStatus status;
        #endregion

        #region Constructor
        /// <summary>
        /// Initializes a new instance of the Tweet class.
        /// </summary>
        /// <param name="status">The tweet status.</param>
        public Tweet(TwitterStatus status)
        {
            this.status = status;
        }
        #endregion

        #region Properties
        /// <summary>
        /// Gets the created date.
        /// </summary>
        public string CreatedDate
        {
            get
            {
                ////return status.CreatedDate.ToLongDateString() + "  " + status.CreatedDate.ToLocalTime().ToLongTimeString();
                return this.status.CreatedDate.ToString("MMM dd, yyyy") + "  " + this.status.CreatedDate.ToLocalTime().ToLongTimeString();
            }
        }

        /// <summary>
        /// Gets the text.
        /// </summary>
        public string Text
        {
            get
            {
                return this.status.Text;
            }
        }

        /// <summary>
        /// Gets the screen name.
        /// </summary>
        public string ScreenName
        {
            get
            {
                return this.status.User.ScreenName;
            }
        }

        /// <summary>
        /// Gets the profile image Url.
        /// </summary>
        public string ProfileImageUrl
        {
            get
            {
                return this.status.User.ProfileImageUrl;
            }
        }

        /// <summary>
        /// Gets the underlying TwitterStatus object.
        /// </summary>
        public TwitterStatus Status
        {
            get
            {
                return this.status;
            }
        }
        #endregion
    }
}
